<template>
  <div class="back-top"
    visibilityheight="20"
    style="right: 25px;"
    @click="toTop">
    <div class="back-top-content">
      <div class="back-top-icon"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CommonLink',
  methods: {
    toTop() {
      window.scrollTo(0, 0)
    },
  },
}
</script>
<style lang='scss' scoped>
.back-top {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: rgba(0, 0, 0, 0.65);
  font-size: 14px;
  font-variant: tabular-nums;
  line-height: 1.5;
  list-style: none;
  font-feature-settings: 'tnum';
  position: fixed;
  right: 25px;
  bottom: 50px;
  z-index: 10;
  width: 40px;
  height: 40px;
  cursor: pointer;
  .back-top-content {
    width: 40px;
    height: 40px;
    overflow: hidden;
    color: #fff;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.45);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    &:hover {
      background-color: #7150e6 !important;
    }
    .back-top-icon {
      width: 14px;
      height: 16px;
      margin: 12px auto;
      background: url()
        100%/100% no-repeat;
    }
  }
}
</style>